home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
monitory
/
amyload
/
drawdataline.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-11-15
|
1KB
|
58 lines
#include <intuition/intuition.h>
#include "execdef.h"
#include "intuidef.h"
#include "loadrecord.h"
#include "windowinfo.h"
#include "DrawDataLine.proto"
#include <graphics/proto.h>
void
DrawDataLine(window, record, x, value)
Window *window;
LoadRecord *record;
short x;
LoadDataValue value;
{
WindowInfo *window_info;
register short deltay, moduloy, y, miny;
unsigned char data_pen_num, ref_pen_num;
register RastPort *rport;
window_info = WINDOWINFO(window);
data_pen_num = record->data_pen_num;
ref_pen_num = record->ref_pen_num;
x += window_info->leftedge;
rport = window->RPort;
y = window_info->bottomedge;
miny = y - (value * window_info->height) / record->scaled_ticks;
Move(rport, x, y);
if (record->scale <= 1)
{
SetAPen(rport, record->data_pen_num);
Draw(rport, x, miny);
}
else
{
deltay = record->deltay;
moduloy = record->moduloy;
do
{
y -= deltay;
if (moduloy-- > 0)
y--;
SetAPen(rport, data_pen_num);
if ( y < miny)
{
Draw(rport, x, miny);
break;
}
Draw(rport, x, y);
SetAPen(rport, ref_pen_num);
WritePixel(rport, x, y);
Move(rport, x, (short)(y-1));
} while (y >= miny);
}
}